import Vue from 'vue'
import VueRouter from 'vue-router'

Vue.use(VueRouter)

// 路由信息数组
const routes = [
    //首页
    {
        path: '/',
        component: () => import('@v/index.vue')
    },
    // 登录页
    {
        path: '/login',
        component: () => import('@v/login.vue')
    },
    // 后台管理布局页
    {
        path: '/layout',
        component: () => import('@v/layout.vue'),
        // 配置嵌套路由
        children: [
            {
                path: 'ecommerce',
                component: () => import('@v/ecommerce/jingDong.vue')
            }
        ]
    },
    {
        // *号表示剩余的全部情况
        path: '*',
        component:() =>import('@v/error404.vue')
    }
]

const router = new VueRouter({
    mode: 'history',
    base: process.env.BASE_URL,
    routes
})

export default router
